open(BUFF,"test3_ahmed_sorted") or die "no file found first\n";
open(BUFF1,"test2_ori_sorted")or die "no file found second\n";
while(<BUFF>)
{
	chomp($_);
	$line = <BUFF1>;
	chomp($line);
	@a = split(" ",$_);
	@a1 = split(" ",$line);
	if(@a != @a1)
	{
		die "number not equal $.\n";
	}
	$n1 = 0;
	$n2 = 0;
	for($i=1;$i<@a;$i++)
	{
		$m = $i;
                $i++;
                $n = $i;
		if($a1[$m] ne "0" && $a1[$n] ne "0")
		{	
			$n1++;
			
			if(($a[$m] eq $a1[$m]  && $a[$n] eq $a1[$n]) || ($a[$m] eq $a1[$n]  && $a[$n] eq $a1[$m]))
			{
				$n2++;
			}
			else
			{
				$a[$m] =~ tr/ATGC/TACG/;
				$a[$n] =~ tr/ATGC/TACG/;
				if(($a[$m] eq $a1[$m]  && $a[$n] eq $a1[$n]) || ($a[$m] eq $a1[$n]  && $a[$n] eq $a1[$m]))
                       		{
                                	$n2++;
                        	}
			}
		}
	}
	print "$a[0]\t$a1[0]\t$n1\t$n2\n";
}
